package org.manon.json.io;

import java.io.IOException;

import org.manon.json.Setter;


/**
 * @author <a href="mailto:jacques.militello@gmail.com">Jacques Militello</a>
 */
public interface Deserializer<T> {

	T deserialize(InputReader input) throws IOException;

	/**
	 * @return a new instance of the Pojo.
	 */
	T newPojoInstance();
	
	/**
	 * @param key	the name of the field
	 * @return the Setter to set the value of the field.
	 */
	<E> Setter<T,E> getSetter(String key);

	/**
	 * @return true if the pojo has one or more subclass(es)
	 */
	boolean pojoHasSubClass();
	
	
	<E extends T> Deserializer<E> getSubDeserializer(String disc);
}